package cn._2dland.comment.locator
{
	import cn._2dland.comment.CommentMC;
	
	import flash.geom.Rectangle;

	public class DriftUpLocator extends CommentLocator
	{
		public function DriftUpLocator() {
			super();
		}

		override public function locate(cmnt:CommentMC, rect:Rectangle):void {
			// 上飘弹幕水平速度为0
			cmnt.xSpeed = 0;

			// 计算起点位置
			cmnt.x = (rect.width - cmnt.width) / 2;
			cmnt.y = rect.height - 20;

			// 计算垂直速度
			var distance:Number = 0 - cmnt.height - cmnt.y;
			cmnt.ySpeed = distance / cmnt.life;

			_comments.push(cmnt);
		}
	}
}